package com.kwok.boot.rabbitmq.workqueues.consumer.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class QueueListener {

    // 监听队列，通过队列名称来指定要监听哪个队列
    @RabbitListener(queues = "Work-Queues")
    public void consumerOneReceiveMessageFromQueue(String message) {
        log.debug("消费者一从队列中接收到的消息数据是：{}", message);
    }

    // 监听队列，通过队列名称来指定要监听哪个队列
    @RabbitListener(queues = "Work-Queues")
    public void consumerTwoReceiveMessageFromQueue(String message) {
        log.debug("消费者二从队列中接收到的消息数据是：{}", message);
    }

}
